inline 
hue_features::hue_features(const int in_nBins)
: nBins(in_nBins)
{
}

inline 
vec 
hue_features::hist_Hue(const cv::Mat &im_in)
{
  
  cv::Mat hsv;
  cvtColor(im_in, hsv, cv::COLOR_BGR2HSV); // OpenCV uses BGR color space
  //cout << "nf " << nf << endl;
  
  /// Separate the image in 3 places ( H, S and V )
  vector<cv::Mat> hsv_planes;
  split( hsv, hsv_planes );
  double minVal, maxVal;
  minMaxLoc(hsv_planes[0], &minVal, &maxVal); //find minimum and maximum intensities
  //cout << "min= " << minVal << ". max= " << maxVal << endl;
  /// Set the ranges ( for H,S,V) )
  // Betweeen 1 and 180, the stddvt of a black image is zero No estoy segura probar otra vez
  float range[] = { 0, 180 } ; // Duda, el rango de Hu component es de 0 a 360? 
  const float* histRange = { range };
  bool uniform = true; 
  bool accumulate = false;
  cv::Mat h_hist;// s_hist, v_hist;
  hsv_planes[0] = hsv_planes[0];
  /// Compute the histogram in the H component:
  cv::calcHist( &hsv_planes[0], 1, 0, cv::Mat(), h_hist, 1, &nBins, &histRange, uniform, accumulate );

  /// Saving hist in a vector arma::vec
  vec hist_vec;
  hist_vec.zeros(nBins);
  for( int i = 0; i < nBins; i++ )
  {
    hist_vec(i) = h_hist.at<float>(i);
  }
 
  return hist_vec;
  
}


